<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/11/21
 * Time: 11:52
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\api\controller\v1;

use app\api\controller\Base;
use app\common\business\School as BusObj;
use app\common\lib\Show;
use app\common\lib\Status;
use think\App;

class School extends Base
{
    protected BusObj $busObj;

    public function __construct(App $app)
    {
        parent::__construct($app);
        $this->busObj = new BusObj();
    }

    /**
     * @return \think\response\Json
     */
    public function getSchoolList(){
        try {
            $school = $this->busObj->getListData("id as value,title as name");
        }catch (\Exception $e){
            return Show::json_show(Status::mini_error,$e->getMessage());
        }
        return Show::json_show(Status::mini_normal,"ok",[
            "school"=>$school
        ]);
    }
}